Optimal. Leaf size=151 \[ \frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{x (c+d x)}{4 a^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{3 i d x}{16 a^2 f}-\frac{d x^2}{8 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.141943, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3479, 8, 3730} \[ \frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{x (c+d x)}{4 a^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{3 i d x}{16 a^2 f}-\frac{d x^2}{8 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3479
Rule 8
Rule 3730
Rubi steps
\begin{align*} \int \frac{c+d x}{(a+i a \tan (e+f x))^2} \, dx &=\frac{x (c+d x)}{4 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-d \int \left (\frac{x}{4 a^2}+\frac{i}{4 f (a+i a \tan (e+f x))^2}+\frac{i}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}\right ) \, dx\\ &=-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{(i d) \int \frac{1}{(a+i a \tan (e+f x))^2} \, dx}{4 f}-\frac{(i d) \int \frac{1}{a^2+i a^2 \tan (e+f x)} \, dx}{4 f}\\ &=-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{d}{8 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{(i d) \int 1 \, dx}{8 a^2 f}-\frac{(i d) \int \frac{1}{a+i a \tan (e+f x)} \, dx}{8 a f}\\ &=-\frac{i d x}{8 a^2 f}-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{(i d) \int 1 \, dx}{16 a^2 f}\\ &=-\frac{3 i d x}{16 a^2 f}-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}\\ \end{align*}
Mathematica [A] time = 0.462507, size = 130, normalized size = 0.86 \[ -\frac{\sec ^2(e+f x) \left (\left (4 c f (1+4 i f x)+d \left (8 i f^2 x^2+4 f x-i\right )\right ) \sin (2 (e+f x))+\left (4 c f (4 f x+i)+d \left (8 f^2 x^2+4 i f x+1\right )\right ) \cos (2 (e+f x))+8 (2 i c f+2 i d f x+d)\right )}{64 a^2 f^2 (\tan (e+f x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.22, size = 82, normalized size = 0.5 \begin{align*}{\frac{d{x}^{2}}{8\,{a}^{2}}}+{\frac{cx}{4\,{a}^{2}}}+{\frac{{\frac{i}{8}} \left ( 2\,dfx-id+2\,cf \right ){{\rm e}^{-2\,i \left ( fx+e \right ) }}}{{a}^{2}{f}^{2}}}+{\frac{{\frac{i}{64}} \left ( 4\,dfx-id+4\,cf \right ){{\rm e}^{-4\,i \left ( fx+e \right ) }}}{{a}^{2}{f}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.58873, size = 220, normalized size = 1.46 \begin{align*} \frac{{\left (4 i \, d f x + 4 i \, c f + 8 \,{\left (d f^{2} x^{2} + 2 \, c f^{2} x\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (16 i \, d f x + 16 i \, c f + 8 \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} f^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.764843, size = 228, normalized size = 1.51 \begin{align*} \begin{cases} \frac{\left (\left (32 i a^{6} c f^{5} e^{8 i e} + 32 i a^{6} d f^{5} x e^{8 i e} + 8 a^{6} d f^{4} e^{8 i e}\right ) e^{- 4 i f x} + \left (128 i a^{6} c f^{5} e^{10 i e} + 128 i a^{6} d f^{5} x e^{10 i e} + 64 a^{6} d f^{4} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{512 a^{8} f^{6}} & \text{for}\: 512 a^{8} f^{6} e^{12 i e} \neq 0 \\\frac{x^{2} \left (2 d e^{2 i e} + d\right ) e^{- 4 i e}}{8 a^{2}} + \frac{x \left (2 c e^{2 i e} + c\right ) e^{- 4 i e}}{4 a^{2}} & \text{otherwise} \end{cases} + \frac{c x}{4 a^{2}} + \frac{d x^{2}}{8 a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.16078, size = 144, normalized size = 0.95 \begin{align*} \frac{{\left (8 \, d f^{2} x^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 16 \, c f^{2} x e^{\left (4 i \, f x + 4 i \, e\right )} + 16 i \, d f x e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, d f x + 16 i \, c f e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, c f + 8 \, d e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} f^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]